<% content_for :sitemap do %>
  <span class="current">用户</span>
<% end %>
<div class="toolbar">
  <form class="form-inline" action="<%= cpanel_users_path %>">
    <div class="form-group">
      <input type="text" name="q" class="form-control" value="<%= params[:q] %>" placeholder="用户名" />
    </div>
    <button class="btn btn-default">搜索</button>
  </form>
</div>

<table class="table table-bordered table-striped table-condensed">
  <tr class="head">
    <td class="first">#</td>
    <td>帐号</td>
    <td>姓名</td>
    <td>Email</td>
    <td>注册时间</td>
    <td>操作</td>
  </tr>

<% @users.each do |user| %>
  <tr>
    <td class="first"><%= user.id %></td>
    <td><%= user_name_tag(user) %></td>
    <td><%= user.name %></td>
    <td><%= user.email %></td>
    <td><%= user.created_at.to_date %></td>
    <td>
      <%= link_to '', edit_cpanel_user_path(user.id), class: "fa fa-pencil" %>
    </td>
  </tr>
<% end %>
</table>
<%= will_paginate @users %>
